package com.wangxinrou.wangxinrou_surprisemeal.common;

import lombok.Getter;

@Getter
public enum ResultCode {
    SUCCESS(true, 20000, "成功"),
    USER_NOT_FOUND(false, 20001, "用户不存在"),
    USER_ALREADY_EXISTS(false, 20002, "用户已存在"),
    USER_UPDATE_SUCCESS(true, 20003, "用户信息更新成功"),
    USER_UPDATE_FAILURE(false, 20004, "用户不存在，无法更新"),
    USER_DELETE_SUCCESS(true, 20005, "用户删除成功"),
    USER_DELETE_FAILURE(false, 20006, "用户不存在，无法删除"),
    UNKNOWN_REASON(false, 21001, "未知错误"),
    BAD_SQL_GRAMMAR(false, 21002, "SQL语法错误"),
    JSON_PARSE_ERROR(false, 21003, "JSON解析异常"),
    PARAM_ERROR(false, 21004, "参数不正确"),
    FILE_UPLOAD_ERROR(false, 21005, "文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(false, 21006, "Excel数据导入错误");

    private boolean success;
    private Integer code;
    private String message;
    private Object data;

    private ResultCode(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}